import routerNewConfig from './router-newConfig.js'
import merchantConfig from './router-merchantConfig.js'
import oldConfig from './router-config.js'
import {commerceWebchat, standardWebchat} from './router-webchat.js'
let root = {
	path: '/index',
	component: () => import(/* webpackChunkName: "main" */ '@/components/ui-modules/index.vue').then(m => m.default),
	children: []
}
// 简单版设置
let newConfig = {
	path: 'newConfig',
	name: 'newConfig',
	component: () => import(/* webpackChunkName: "newConfig" */ '@/components/business-modules/newConfig/index.vue').then(m => m.default),
	meta: {
		title: 'config'
	},
	children: routerNewConfig
}
// 老版设置
let config = {
	path: 'config',
	name: 'config',
	component: () => import(/* webpackChunkName: "config" */ '@/components/business-modules/config/index.vue').then(m => m.default),
	meta: {
		title: 'config'
	},
	children: oldConfig
}
// 电商版设置
let merchant = {
	path: 'config',
	name: 'config',
	component: () => import(/* webpackChunkName: "newConfig" */ '@/components/business-modules/merchantConfig/index.vue').then(m => m.default),
	meta: {
		title: 'config'
	},
	children: merchantConfig
}
let xbot = {
	path: 'xrobot',
	name: 'xrobot',
	component: () => import(/* webpackChunkName: "report" */ '@/components/business-modules/xrobot/index.vue').then(m => m.default),
	meta: {
		title: 'xrobot'
	}
}
let ebot = {
	path: 'xrobot',
	name: 'xrobot',
	component: () => import(/* webpackChunkName: "report" */ '@/components/business-modules/eRobot/index.vue').then(m => m.default),
	meta: {
		title: 'xrobot'
	}
}
export default function dynamicRoute (isEcommerce) {
	if (isEcommerce) {
		root.children = [commerceWebchat, merchant, ebot]
	} else {
		root.children = [standardWebchat, xbot, newConfig, config]
	}
	return [root]
}